<template>
<div class="x">
<div class="info">
  <!-- <h2>个人信息</h2> -->
  <img src="../../public/static/tou.jpeg" alt="">
  <div class="in">姓名：{{name}}</div>
  <div class="in">座右铭：买光所有的衣服</div>
  <div class="in">家庭住址：花果山水帘洞</div>
</div>
</div>  
</template>
<script>
import axios from 'axios'
  export default {
    data() {
      return {
        name:JSON.parse(sessionStorage.getItem('user')).name
      }
    },

    methods: {
      onSubmit() {
        console.log('submit!');
      }
    },
    create(){
      if(window.$x.name != undefined){
        axios.get(`http://localhost:8088/user`,{
          params:{
            name:window.$x.name
          }
        }).then(response=>{
          if(response.data){
            //console.log(this.GLOBAL)
            this.GLOBAL.user = response.data
            //console.log(this.GLOBAL)
          }
        })
      }else{
        this.$message({
          type:'error',
          message:'请登录'
          
        })
        console.log('错浏览')
      }
    }
    
  }
</script>
<style scoped>
.x {
  position: relative;
  width: 100%;
  height: 100%;
  background-color: #eee;
  margin: 0px;
}
.info {
  position:absolute;
  top: 13%;
  left:28%;
  width: 500px;
  height: 500px;
  background: linear-gradient(to top, rgb(0, 255, 136), 5%, pink);
  box-shadow: -15px 10px 25px black;
  text-align: center;

}
h2 {
  padding: 30px 0;
}
img {
  width: 200px;
  border-radius: 100%;
  animation: all 2s linear infinite;
  padding: 20px 0;
}
img:hover{
  transform: rotateX(360deg);
}
.in {
  padding: 20px 0px;
}
</style>